﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions {
    import Engine.Transactions.*;
    import Classes.util.*;
    import Display.*;

    public class TRenameCity extends Transaction {

        private var m_cityName:String;

        public function TRenameCity(_arg1:String){
            this.m_cityName = _arg1;
            super();
        }
        override public function perform():void{
            signedCall("UserService.setCityName", "renameCity", this.m_cityName);
        }
        override protected function onComplete(_arg1:Object):void{
            if (_arg1.hasOwnProperty("name")){
                if (_arg1["result"] == INVALID_DATA){
                    UI.displayMessage(ZLoc.t("Dialogs", "InvalidCityName"));
                    return;
                };
                UI.setCityName(_arg1["name"]);
                Global.player.cityName = _arg1["name"];
                GameTransactionManager.addTransaction(new TOnValidCityName(), true);
            };
        }

    }
}//package Transactions 
